package entity

import "context"

const (
	//消息类型
	MsgTypeNormal = 1
	MsgTypeNotify = 2

	//消息接收人数
	ReceiverTypeSingle    = 1
	ReceiverTypeBroadcast = 2
	ReceiverTypeGroup     = 3
	ReceiverTypeExclude   = 4

	//广播类型
	BroadcastAll     = 1
	BroadcastInclude = 2
	BroadcastExclude = 3

	//响应的网关
	CoreResultTypeOne = 1
	CoreResultTypeAll = 2
)

type UserModel struct {
	Id    int
	Name  string
	Token string
	Uuid  string
	Ip    string
}

type ServiceContext struct {
	context.Context
	CoreInModel
	RespChan chan CoreResultModel
}

func NewServiceContext(ctx context.Context, coreIn CoreInModel, respChan chan CoreResultModel) ServiceContext {
	if ctx == nil {
		ctx = context.Background()
	}
	return ServiceContext{
		Context:     ctx,
		CoreInModel: coreIn,
		RespChan:    respChan,
	}
}
